//package com.plian.system.controller.sys.warning;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.system.entity.sys.warning.WarningReport;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.sys.warning.IWarningReportService;
//import com.plian.system.vo.sys.warning.WarningReportVO;
//import com.plian.system.wrapper.sys.warning.WarningReportWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//
///**
// * 预警报告
// */
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/warningReport")
//@Api(value = "WarningReportController", tags = "预警报告 控制器")
//public class WarningReportController extends BaseController {
//
//    private final IWarningReportService warningReportService;
//
//    private final WarningReportWrapper warningReportWrapper;
//
//    /**
//     * @param reportVO
//     * @return
//     */
//    @PostMapping("/submit")
//    @ApiOperation(value = "预警报告-新增", notes = "传入 vo")
//    public R submit(@RequestBody WarningReportVO reportVO) {
//        return R.data(warningReportService.submit(reportVO));
//    }
//
//
//    /**
//     * @param query
//     * @return
//     */
//    @PostMapping("/list")
//    @ApiOperation(value = "预警报告-列表", notes = "传入 vo")
//    public ListResult<WarningReportVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs() == null && query.getDescs() == null) {
//            query.setDescs("create_time");
//        }
//        QueryWrapper<WarningReport> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new WarningReport()), entityList
//        );
//        IPage<WarningReport> pages = warningReportService.page(Condition.getPage(query), queryWrapper);
//        List<WarningReportVO> warningReportVOS = warningReportWrapper.entityToVO(pages.getRecords());
//        ListResult<WarningReportVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        listResult.setList(warningReportVOS);
//        listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//        return listResult;
//    }
//
//
//    /**
//     * @param report
//     * @return
//     */
//    @PostMapping("/detail")
//    @ApiOperation(value = "预警报告-详情", notes = "传入 vo")
//    public R detail(@RequestBody WarningReport report) {
//        WarningReport detail = warningReportService.getOne(Condition.getQueryWrapper(report));
//        return R.data(warningReportWrapper.entityToVO(detail));
//    }
//
//    /**
//     * @param reportVO
//     * @return
//     */
//    @PostMapping("/remove")
//    @ApiOperation(value = "预警报告-删除", notes = "传入 vo")
//    public R remove(@RequestBody WarningReportVO reportVO) {
//        List<Long> ids = reportVO.getIds();
//        return R.status(warningReportService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA))));
//    }
//
//}
